package ae.pcfc.etks.online.itworx.ehs.web.exception;

import ae.pcfc.etks.online.itworx.ehs.web.common.exception.BaseException;
import ae.pcfc.etks.online.itworx.ehs.web.model.Rollback;

public class CommunicationException extends Exception implements BaseException {

	private static final long serialVersionUID = 1L;

	private Rollback rollbackBean = null;
	private String errorCode = null;

	public CommunicationException() {
		super();
	}

	public CommunicationException(final String message) {
		super(message);
	}
	
	public CommunicationException(final Throwable throwable) {
		super(throwable);
	}

	public CommunicationException(final String message,
			final Throwable throwable) {
		super(message, throwable);
	}

	public CommunicationException(final Rollback rollbackBean) {
		super(rollbackBean.toString());
		setErrorRollbackBean(rollbackBean);
	}
	
	public CommunicationException(final Throwable throwabl,final Rollback rollbackBean) {
		super(throwabl);
		setErrorRollbackBean(rollbackBean);
	}

	@Override
	public void setErrorRollbackBean(Rollback rollbackBean) {
		this.rollbackBean = rollbackBean;
	}

	@Override
	public Rollback getErrorRollbackBean() {
		return rollbackBean;
	}

	@Override
	public String getErrorCode() {
		return errorCode;
	}

	@Override
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;

	}
}
